VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Consorcio"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''
''  Consorcio.cls
''  Implementation of the table Class Consorcio
''  Generated by Enterprise Architect
''  Created on:      15-Abr-2009 08:04:42 p.m.
''  Original author: Administrador
''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Dim rsConsorcio As New ADODB.Recordset


Private m_conCodigo As Integer
Private m_conPresidente As String
Private m_conPresiPiso As Integer
Private m_conPresiDepto As Integer
Private m_conTelefono As String
Private m_conReferenciasPersonales As String
Private m_conAdministrador As String
Private m_conTelefonoAdministrador As String
Private m_conAdministradorDireccion As String
Private m_conVerificaHoraVisita As Date
Private m_conVerificaFecha As Date
Private m_conAntiguedadEdificio As Integer
Private m_conPisos As Integer
Private m_conUnidad As Integer
Private m_conRealizadoPor As String
Private m_conLlamador As String
Private m_conFechaLlamado As String
Private m_conInformante As String
Private m_conConceptoAdmnistrador As String
'Public m_PersonasTelefono As PersonasTelefono


Public Property Get conCodigo() As Integer
    conCodigo = m_conCodigo
End Property
Public Property Let conCodigo(ByVal inNew As Integer)
    If (m_conCodigo = inNew) Then Exit Property
    m_conCodigo = inNew
End Property

Public Property Get conPresidente() As String
    conPresidente = m_conPresidente
End Property
Public Property Let conPresidente(ByVal inNew As String)
    If (m_conPresidente = inNew) Then Exit Property
    m_conPresidente = inNew
End Property

Public Property Get conPresiPiso() As Integer
    conPresiPiso = m_conPresiPiso
End Property
Public Property Let conPresiPiso(ByVal inNew As Integer)
    If (m_conPresiPiso = inNew) Then Exit Property
    m_conPresiPiso = inNew
End Property

Public Property Get conPresiDepto() As Integer
    conPresiDepto = m_conPresiDepto
End Property
Public Property Let conPresiDepto(ByVal inNew As Integer)
    If (m_conPresiDepto = inNew) Then Exit Property
    m_conPresiDepto = inNew
End Property

Public Property Get conTelefono() As String
    conTelefono = m_conTelefono
End Property
Public Property Let conTelefono(ByVal inNew As String)
    If (m_conTelefono = inNew) Then Exit Property
    m_conTelefono = inNew
End Property

Public Property Get conReferenciasPersonales() As String
    conReferenciasPersonales = m_conReferenciasPersonales
End Property
Public Property Let conReferenciasPersonales(ByVal inNew As String)
    If (m_conReferenciasPersonales = inNew) Then Exit Property
    m_conReferenciasPersonales = inNew
End Property

Public Property Get conAdministrador() As String
    conAdministrador = m_conAdministrador
End Property
Public Property Let conAdministrador(ByVal inNew As String)
    If (m_conAdministrador = inNew) Then Exit Property
    m_conAdministrador = inNew
End Property

Public Property Get conTelefonoAdministrador() As String
    conTelefonoAdministrador = m_conTelefonoAdministrador
End Property
Public Property Let conTelefonoAdministrador(ByVal inNew As String)
    If (m_conTelefonoAdministrador = inNew) Then Exit Property
    m_conTelefonoAdministrador = inNew
End Property

Public Property Get conAdministradorDireccion() As String
    conAdministradorDireccion = m_conAdministradorDireccion
End Property
Public Property Let conAdministradorDireccion(ByVal inNew As String)
    If (m_conAdministradorDireccion = inNew) Then Exit Property
    m_conAdministradorDireccion = inNew
End Property

Public Property Get conVerificaHoraVisita() As Date
    conVerificaHoraVisita = m_conVerificaHoraVisita
End Property
Public Property Let conVerificaHoraVisita(ByVal inNew As Date)
    If (m_conVerificaHoraVisita = inNew) Then Exit Property
    m_conVerificaHoraVisita = inNew
End Property

Public Property Get conVerificaFecha() As Date
    conVerificaFecha = m_conVerificaFecha
End Property
Public Property Let conVerificaFecha(ByVal inNew As Date)
    If (m_conVerificaFecha = inNew) Then Exit Property
    m_conVerificaFecha = inNew
End Property

Public Property Get conAntiguedadEdificio() As Integer
    conAntiguedadEdificio = m_conAntiguedadEdificio
End Property
Public Property Let conAntiguedadEdificio(ByVal inNew As Integer)
    If (m_conAntiguedadEdificio = inNew) Then Exit Property
    m_conAntiguedadEdificio = inNew
End Property

Public Property Get conPisos() As Integer
    conPisos = m_conPisos
End Property
Public Property Let conPisos(ByVal inNew As Integer)
    If (m_conPisos = inNew) Then Exit Property
    m_conPisos = inNew
End Property

Public Property Get conUnidad() As Integer
    conUnidad = m_conUnidad
End Property
Public Property Let conUnidad(ByVal inNew As Integer)
    If (m_conUnidad = inNew) Then Exit Property
    m_conUnidad = inNew
End Property

Public Property Get conRealizadoPor() As String
    conRealizadoPor = m_conRealizadoPor
End Property
Public Property Let conRealizadoPor(ByVal inNew As String)
    If (m_conRealizadoPor = inNew) Then Exit Property
    m_conRealizadoPor = inNew
End Property

Public Property Get conLlamador() As String
    conLlamador = m_conLlamador
End Property
Public Property Let conLlamador(ByVal inNew As String)
    If (m_conLlamador = inNew) Then Exit Property
    m_conLlamador = inNew
End Property

Public Property Get conFechaLlamado() As String
    conFechaLlamado = m_conFechaLlamado
End Property
Public Property Let conFechaLlamado(ByVal inNew As String)
    If (m_conFechaLlamado = inNew) Then Exit Property
    m_conFechaLlamado = inNew
End Property

Public Property Get conInformante() As String
    conInformante = m_conInformante
End Property
Public Property Let conInformante(ByVal inNew As String)
    If (m_conInformante = inNew) Then Exit Property
    m_conInformante = inNew
End Property

Public Property Get conConceptoAdmnistrador() As String
    conConceptoAdmnistrador = m_conConceptoAdmnistrador
End Property
Public Property Let conConceptoAdmnistrador(ByVal inNew As String)
    If (m_conConceptoAdmnistrador = inNew) Then Exit Property
    m_conConceptoAdmnistrador = inNew
End Property

Public Sub cargarConsorcio()
    On Error GoTo ErrorHandler
    
    If rsConsorcio.State <> adStateClosed Then
        rsConsorcio.Close
    End If
    rsConsorcio.Open "select * from consorcio where conCodigo = " & m_conCodigo, cn, adOpenKeyset, adLockOptimistic

    m_conCodigo = rsConsorcio.Fields("conCodigo")
    m_conPresidente = rsConsorcio.Fields("conPresidente")
    m_conPresiPiso = rsConsorcio.Fields("conPresiPiso")
    m_conPresiDepto = rsConsorcio.Fields("conPresiDepto")
    m_conTelefono = rsConsorcio.Fields("conTelefono")
    m_conReferenciasPersonales = rsConsorcio.Fields("conReferenciasPersonales")
    m_conAdministrador = rsConsorcio.Fields("conAdministrador")
    m_conTelefonoAdministrador = rsConsorcio.Fields("conTelefonoAdministrador")
    m_conAdministradorDireccion = rsConsorcio.Fields("conAdministradorDireccion")
    m_conVerificaHoraVisita = rsConsorcio.Fields("conVerificaHoraVisita")
    m_conVerificaFecha = rsConsorcio.Fields("conVerificaFecha")
    m_conAntiguedadEdificio = rsConsorcio.Fields("conAntiguedadEdificio")
    m_conPisos = rsConsorcio.Fields("conPisos")
    m_conUnidad = rsConsorcio.Fields("conUnidad")
    m_conRealizadoPor = rsConsorcio.Fields("conRealizadoPor")
    m_conLlamador = rsConsorcio.Fields("conLlamador")
    m_conFechaLlamado = rsConsorcio.Fields("conFechaLlamado")
    m_conInformante = rsConsorcio.Fields("conInformante")
    m_conConceptoAdmnistrador = rsConsorcio.Fields("conConceptoAdmnistrador")
    
ErrorHandler:
    If Err <> 0 Then
        MsgBox Err.Source & "-->" & Err.Description, , "Error"
    End If
End Sub


Public Function crearConsorcio(Optional ByRef mensaje As String) As Boolean
    'If Not IsEmpty(carpaNombre) Then
    Dim strInsert As String
    
    strInsert = "Insert into Consorcio (conPresidente, conPresiPiso, conPresiDepto," _
    & " conTelefono, conReferenciasPersonales, conAdministrador, conTelefonoAdministrador," _
    & " conAdministradorDireccion, conVerificaHoraVisita, conVerificaFecha," _
    & " conAntiguedadEdificio, conPisos, conUnidad, conRealizadoPor, conLlamador," _
    & " conFechaLlamado, conInformante, conConceptoAdmnistrador) values " _
    & "(" & m_conPresidente & ", " & m_conPresiPiso & ", " & m_conPresiDepto & ", " _
    & m_conTelefono & ", " & m_conReferenciasPersonales & ", " & m_conAdministrador & ", " _
    & m_conTelefonoAdministrador & ", " & m_conAdministradorDireccion & ", " _
    & m_conVerificaHoraVisita & ", " & m_conVerificaFecha & ", " & m_conAntiguedadEdificio & ", " _
    & m_conPisos & ", " & m_conUnidad & ", " & m_conRealizadoPor & ", " _
    & m_conLlamador & ", " & m_conFechaLlamado & ", " & m_conInformante & ", " _
    & m_conConceptoAdmnistrador & ")"
    
    rsConsorcio.Open strInsert, cn, adOpenStatic, adLockPessimistic
    
    If rsConsorcio.Status = adStatusErrorsOccurred Then
        mensaje = "No pudo crease el registro"
        crearConsorcio = False
    Else
        mensaje = "Consorcio creado correctamente"
        crearConsorcio = True
    End If
    rsConsorcio.Close
End Function



Public Function modificarConsorcio(Optional ByRef mensaje As String) As Boolean
    Dim strUpdate As String
    
    strUpdate = "Update Consorcio set conPresidente= " & m_conPresidente _
    & ", conPresiPiso= " & m_conPresiPiso & ", conPresiDepto= " & m_conPresiDepto _
    & ", conTelefono= " & m_conTelefono & ", conReferenciasPersonales= " & m_conReferenciasPersonales _
    & ", conAdministrador= " & m_conAdministrador & ", conTelefonoAdministrador=" & m_conTelefonoAdministrador _
    & ", conAdministradorDireccion =" & m_conAdministradorDireccion & ", conVerificaHoraVisita=" _
    & m_conVerificaHoraVisita & ", conVerificaFecha=" & m_conVerificaFecha _
    & ", conAntiguedadEdificio=" & m_conAntiguedadEdificio & ", conPisos=" & m_conPisos _
    & ", conUnidad=" & m_conUnidad & ", conRealizadoPor=" & m_conRealizadoPor _
    & ", conLlamador=" & m_conLlamador _
    & ", conFechaLlamado=" & m_conFechaLlamado & ", conInformante=" & m_conInformante _
    & "conConceptoAdmnistrador= " & m_conConceptoAdmnistrador & ")"
    
        
    rsConsorcio.Open strUpdate, cn, adOpenStatic, adLockPessimistic
    
    If rsConsorcio.Status = adStatusErrorsOccurred Then
        mensaje = "No pudo crease el registro"
        modificarConsorcio = False
    Else
        mensaje = "Consorcio modificado correctamente"
        modificarConsorcio = True
    End If
    rsConsorcio.Close
    
End Function
